package com.example.todolist

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText

import android.annotation.SuppressLint
import android.content.ContentValues
import android.content.Intent

import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

import android.widget.TextView
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import java.io.BufferedReader
import java.io.BufferedWriter
import java.io.InputStreamReader
import java.io.OutputStreamWriter
import java.lang.StringBuilder
import java.util.ArrayList

class delete : AppCompatActivity() {
    lateinit var helper: DBHelper

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_delete)
        helper = DBHelper(this, "todo.db", 1)
    }


    fun onClick03(view: View) {
        val textdelete = findViewById<EditText>(R.id.ipt_deletetext).text.toString()
        val db=helper.writableDatabase
        db.delete("Todo","id=?", arrayOf(textdelete))
        startActivity(Intent(this,MainActivity::class.java))
    }

}